# 代码结果：
    # ConcreteHandler1: Handling two
    # ConcreteHandler2: Handling two

from abc import ABC, abstractmethod

# 抽象处理器类
class Handler(ABC):
    def __init__(self):
        self._next = None

    def set_next(self, next: 'Handler') -> None:
        self._next = next

    def get_next(self) -> 'Handler':
        return self._next

    @abstractmethod
    def handle_request(self, request: str) -> None:
        pass

# 具体处理器类 1
class ConcreteHandler1(Handler):
    def handle_request(self, request: str) -> None:
        print(f"ConcreteHandler1: Handling {request}")
        if self._next:
            self._next.handle_request(request)

# 具体处理器类 2
class ConcreteHandler2(Handler):
    def handle_request(self, request: str) -> None:
        print(f"ConcreteHandler2: Handling {request}")

# 客户端类
class ChainOfResponsibilityPattern:
    def main(self, args: list[str]) -> None:
        handler1 = ConcreteHandler1()
        handler2 = ConcreteHandler2()
        handler1.set_next(handler2)
        handler1.handle_request("two")

# 客户端使用示例
if __name__ == "__main__":
    chain = ChainOfResponsibilityPattern()  # 确保这里使用的是正确的类名
    chain.main(["two"])